package com.stsdai.order.quartz;

import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.springframework.context.ApplicationContext;
import org.springframework.scheduling.quartz.QuartzJobBean;

import com.stsdai.order.service.OrderService;

public class OrderQuartz extends QuartzJobBean {

	@Override
	protected void executeInternal(JobExecutionContext context) throws JobExecutionException {
		//定时触发执行这个方法的
		ApplicationContext applicationContext = (ApplicationContext) context.getJobDetail().getJobDataMap()
                .get("applicationContext");
		//这个方法就是来清理无效订单的
		applicationContext.getBean(OrderService.class).cleanOrder();
		
	}

}
